function [L2meanResd, maxResd] = cfdScreenPlotPhy(timeIrt)
%--------------------------------------------------------------------------
%  Written by LiuHaHa @ NWPU, 2022 01 
%  Contact me at: liuzhikan@mail.nwpu.edu.cn
%==========================================================================
% Routine Description:
%   This function prints residuals to console
%--------------------------------------------------------------------------
global cfdFlow cfdOutput slvpara;

[L2meanResd, maxResd] = cfdCalculateResd;

clf;

if(timeIrt == slvpara.screen_sub_stp)
    cfdOutput.iters = timeIrt;
    cfdOutput.resd = [L2meanResd;maxResd];       
else
    cfdOutput.iters=[cfdOutput.iters timeIrt];
    cfdOutput.resd=[cfdOutput.resd [L2meanResd;maxResd]];   
    
end

semilogy(cfdOutput.iters, cfdOutput.resd(1,:), '-*r',cfdOutput.iters, cfdOutput.resd(2,:), '->b'); 
xlabel('Global Iterations');
ylabel('Residuals');
legend('L2meanResd','maxResd');

grid;
axis tight;
set(gca,'ylim',[1e-6 1e2])

pause(0.01);

if(isnan(L2meanResd) || isnan(maxResd))      
    error('Error:  Wan Dan Le :  NaN  NaN  \n');
end
    
       
       
       